var mongoose = require('./db');
var Schema = require('mongoose').Schema;





var puser = new Schema({
    username : String,
    email: String,
    password: String ,
    img: {type:String,default:'../public/images/avatar.png'},
    Contact_info: {
		mobile: {type:Number, default:13800138000},
        office: {type:Number, default:59349000}
    },
    Rconf:[{
        conf_name: String,
        n_pwd: String,
        m_pwd: String,
        start_time: Date,
        end_time:  Date,
        paticpants: [],
        auto_call: Boolean}]
});

var User = mongoose.model('users',puser);

module.exports = User;

/*
puser.methods.Get = function(name,callback){
    User.findOne({'username':name}, 'username email password Contact_info', function(err, user){
        if(err) callback(err,null);
        var iuser = {
            pname: user.username,
            pemail: user.email,
            pwd: user.password,
            cinfo: user.Contact_info
        };
        callback(iuser);
    });
};
*/
